import Vue from 'vue'
import Router from 'vue-router'
import shoppingMall from '@/components/page/shoppingMall'
import register from '@/components/page/register'
import login from '@/components/page/login'
import goods from '@/components/page/Goods' //商品详情
import CategoryList from '@/components/page/CategoryList'  //商品列表
import Cart from '@/components/page/Cart'  //购物车页面
import member from '@/components/page/Member' //会员
import main from '@/components/page/main'  //下面tabs

Vue.use(Router)

export default new Router({
  routes: [
    {
      redirect:'/shoppingMall',
      path:'/',
      component:main,
    },
    {
      path:'/main',
      name:'main',
      component:main,
        children:[
          {
            path: '/shoppingMall',
            name: 'shoppingMall',
            component: shoppingMall
          },
          {
            path:'/CategoryList',
            name:'CategoryList',
            component:CategoryList
          },
          {
            path:'/Cart',
            name:'Cart',
            component:Cart
          },
          {
            path:'/member',
            name:'member',
            component:member
          }

        ]
    },
    {
      path:'/register',
      name:'register',
      component:register
    },
    {
      path:'/login',
      name:'login',
      component:login
    },
    {
      path:'/goods',
      name:'goods',
      component:goods
    }
    // {
    //   path: '/',
    //   name: 'shoppingMall',
    //   component: shoppingMall
    // },
    // {
    //   path:'/CategoryList',
    //   name:'CategoryList',
    //   component:CategoryList
    // },
    // {
    //   path:'/Cart',
    //   name:'Cart',
    //   component:Cart
    // }
  ]
})
